#ifndef __OTA_H
#define __OTA_H

#ifdef __cplusplus
 extern "C" {
#endif

#include "System.h"

#if ENABLE_OTA

typedef enum {
	OTA_OK = 0,
	OTA_FAIL,
	OTA_PACK_ERR,
	OTA_READY,
	OTA_DOWNLOAD,
	OTA_UPDATE,
	OTA_SUCCEED,
	
}OtaStatus_E;
typedef enum {
	OTA_NULL = 0,
	OTA_CODE,
	OTA_RESOURCE,
	OTA_PROGRESS,
	OTA_MAX,
}OtaType_E;
typedef struct {
	UINT8	status;
	UINT8	otaType;
	UINT32	totalSize;
	UINT32	packNum;
	UINT32	section;
	UINT32	size;
}OtaHandle_T;

extern UINT32 g_JumpInit;

UINT8 	OTA_RestData(void);
UINT8 	OTA_ParseData(UINT8 _type,UINT8 *_buf,UINT8 _len);
UINT32 	OTA_GetPackNum(void);

UINT8 	OTA_UpdateCode(void);
UINT8 	OTA_UpdateResource(void);

UINT8 OTA_UpdateDetect(void);
#endif

#ifdef __cplusplus
}
#endif
#endif

